class HomeController < ApplicationController
  layout "home"
  
  def index
    # 校园要闻、大图新闻
    @school_important_news = News.index_news.where(is_important_news: 1).where(:enable =>true).order("ordinal desc").order("pubtime desc").order("created_at desc").limit(11)
    @top_news = TopNews.where(:status => 1).order("created_at desc").limit(5)
    @toutiao = News.index_news.where(:is_top => 1).first
       

    # 校园要讯、通知公告
    @school_message_news = News.index_news.where(is_important_news: 0).
                                where("category_id!= 21").where(:enable =>true).
                                order("ordinal desc").order("pubtime desc").order("created_at desc").limit(10)
    @notifies = Notify.where(:check => 2).order("deleted desc").limit(10)

    # 深度报道
    @deep_report_news = News.index_news.where(category_id: NewsHelper::SDBD_CATEGORY).order("pubtime desc").order("created_at desc").limit(5)

    # 热点专题、媒体华理
    @hot_sptitles = Sptitle.all.order("ordinal desc").order("created_at desc").limit(6)
    @media_huali_news = News.where(category_id: NewsHelper::MTHL_CATEGORY).order("pubtime desc").limit(10)

    # 讲座报告、新媒体入口
    @reports = Report.where(:check => 2).order("time desc").limit(6)
    @new_medium_entrance =  NewMedium.all.order("postion_num asc").limit(6)
    
    # 图说华理
    @pic_say_huali_news = News.index_news.where(category_id: NewsHelper::TSHL_CATEGORY).order("created_at desc").limit(5)

  end

  def send_file


  end
  

end
